import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from genFragment import *

def exp1():
	filePath = '../data/一号泵.csv'
	data=pd.read_csv(filePath, index_col=0, encoding="utf-8")
	data=data['瞬时流量']
	MAX=data.max()
	MIN=data.min()
	print(MIN,MAX)
	simData = data.values[:200].copy()
	preFrag= simData[-100:]
	simData=gen(preFrag,MAX,MIN,40,200)
	x = [i for i in range(1, len(simData) + 1)]
	plt.plot(x, simData)
	plt.show()
	
def exp2():
	filePath = '../data/一号泵.csv'
	data = pd.read_csv(filePath, index_col=0, encoding="utf-8")
	data = data['出口压力']
	MAX = 136#data.max()
	MIN = 20#data.min()
	print(MIN, MAX)
	preFrag= np.random.rand(200) * (136 - 20) + 20
	simData = gen(preFrag, MAX, MIN, 40, 200)
	x = [i for i in range(1, len(simData) + 1)]
	plt.plot(x, simData)
	plt.show()

if __name__ == '__main__':
	exp2()